package org.deri.feather.common;


public class Triple{
	
	public IRIElement subject;
	public IRIElement predicate;
	public Element object;
	//FIXME The named graph should contains triples instead of be part of them
	public IRIElement graph;
	
	public Triple(IRIElement subject, IRIElement predicate, Element object){
		this.subject = subject;
		this.predicate = predicate;
		this.object = object;
		this.graph = null;
	}
	
	public Triple(IRIElement subject, IRIElement predicate, Element object, IRIElement graph){
		this.subject = subject;
		this.predicate = predicate;
		this.object = object;
		this.graph = graph;
	}
	
	public IRIElement getSubject() {
		return this.subject;
	}
	
	public IRIElement getPredicate() {
		return this.predicate;
	}
	
	public Element getObject() {
		return this.object;
	}
	
	public IRIElement getGraph() {
		return this.graph;
	}
	
	public String toString(){
		String str = subject.getStringValue() + " ---> " + predicate.getStringValue() + " ---> " 
				+ object.getStringValue();
		if (graph != null)
			str+= " --- " + graph.getStringValue();
		
		return str;
	}
}